#ifndef COLORSHADER_H
#define COLORSHADER_H

#include <d3d10effect.h>
#include <string>

#include "Matrix4x4.h"

class ColorShader
{
public:
	ColorShader();
	ColorShader(const ColorShader& other);
	~ColorShader();

	bool Initialize();
	void Shutdown();
	void Render(int indexCount, Matrix4x4 worldMatrix, Matrix4x4 viewMatrix, Matrix4x4 projectionMatrix);

private:
	bool InitializeShader(const std::string& filename);
	void ShutdownShader();
	void OutputShaderErrorMessage(ID3D10Blob* errorMessage, const std::string& shaderFilename);

	void SetShaderParameters(Matrix4x4 worldMatrix, Matrix4x4 viewMatrix, Matrix4x4 projectionMatrix);
	void RenderShader(int indexCount);

private:

	ID3D10Effect* m_Effect;
	ID3D10EffectTechnique* m_Technique;
	ID3D10InputLayout* m_Layout;

	ID3D10EffectMatrixVariable* m_WorldMatrix;
	ID3D10EffectMatrixVariable* m_ViewMatrix;
	ID3D10EffectMatrixVariable* m_ProjectionMatrix;
};

#endif
